# 字符串练习

str1 = '单引号字符串'
str2 = "双引号字符串"
str3 = """
dfdfd
dfdfd
dd
"""
str4 = '单引号字符串'

# str1[0] = '双'
# print(id(str1), id(str4))
# print(dir(str1))

str5 = 'data science'
print(str5.title())
print(str5)
print('字符d在', str5, '中的位置是:', str5.find('d'))
# print(str1, str2, str3)

# name = input('请输入你的姓名： ')
# print(name)

# 列表练习

list1 = ['变量', '常量', '序列', '字符串', '列表']
list2 = list('单引号字符串')
print(list1, list2, list2[0])
list2[0] = 'dan'
print(list2)
del list2[0]
print(list2)
list2.append(123)
print(list2)
list1.extend(list2)
print(list1)
a = [1, 2, 3]
a.insert(2, 2.5)
print(a)

# 元组

t1 = (1, 2, 3)
t2 = tuple(['星期一', '星期二', '星期三', '星期四', '星期五'])
t3 = tuple("abc")
print(t1, t2, sum(t1), t3)
